<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var a = [1,2,2,3,3,4,8,8]
        var b = {}
        var arr = []
        for(var i=0;i<a.length;i++){
            if(!b[a[i]]){
                arr.push(a[i])
                b[a[i]] = true
            }

           
        }
        console.log(arr);




    </script>
</body>
</html>